import { Form, Col } from 'antd'
import React from 'react'
import BaseForm from '../../../components/form/index'
import { IFormItem } from '../../../components/form/index'


export default class ListSearchForm extends BaseForm {
    public renderFormItem(item: IFormItem, ComponentFormItem: any,index:number) {
        return (
            <Col key={index} span={8}>
            <Form.Item key={index} labelCol={{span: 8}} {...item.formItem} label={item.formItem.label}>
               {ComponentFormItem}
            </Form.Item>
            </Col>
        )
    }
    public renderFormItemComponent(item: IFormItem, index: number) {
        const { getFieldDecorator }  = this.props.form
        const {type, component, filedDecorator, name} = item
        const FormItemComponent = this.getFormItemComponent(type)
        return getFieldDecorator(name,filedDecorator)(<FormItemComponent {...component}></FormItemComponent>)
    }
   
}